/************************************************************************/
/*                                                                      */
/*     Program: ccg.h                                                   */
/*     Date:    2/24/95                                                 */
/*     Author:  Erik M. Johansson, translation of Dennis Goodman's      */
/*              FORTRAN constrained least squares conjugate gradient    */
/*              codes                                                   */
/*                                                                      */
/*     Mods:    see notes re TAU1 and TAUX (9/6/05)			*/
/*                                                                      */
/*     (c) Copyright 1995 the Regents of the University                 */
/*         of California.  All rights reserved.                         */
/*                                                                      */
/*     This software is a result of work performed at Lawrence          */
/*     Livermore National Laboratory.  The United States Government     */
/*     retains certain rights therein.                                  */
/*                                                                      */
/************************************************************************/

extern	real	dfdxpc ;	/* input, frac. change df/dx in getsol */

/* ivec definitions */

#define BOUNDED_NC 0
#define UNCONSTRAINED 1
#define FIXED 2
#define BOUNDED_LC_FREE 3
#define BOUNDED_UC_FREE 4
#define BOUNDED_LC_FIXED 5
#define BOUNDED_UC_FIXED 6

/* istop/iqt definitions */

#define RESSQ_LT_DISCRP		-1
#define TOLERANCE_PROBLEMS	-2
#define INITIAL_AP_LT_0 	-3
#define INITIAL_DD_GT_0 	-4
#define NORMAL_STOP	0
#define FN_LT_FMIN	1
#define MAX_ITER_LIMIT	2
#define MAX_FN_CALLS_EXTRAP	3
#define DX_TOO_SMALL	4
#define MAX_FN_CALLS_INTERP	5
#define AP_EQ_AMX	6
#define	GRADIENT	7
#define	INTERRUPT	8

#define MAXITN 50
#define NGOLD 5
#define NSAME 3
#define RHO 1.e-4
#define SIGMA 0.1
#define TAU1 9.0	/* Sept 05: DG suggests possible reduction	*/
#define TAU2 0.1
#define TAU3 0.5
#define	TAUX 2.		/*new Sept 05: (implicit) old was 1. range (1.1,4.) */

#define MAXIT	600		/* max. # iterations in getsol */
#define TOL	1.e-6		/* rel. accuracy of function used by getsol */
#define COSMIN 0.01
#define GAMMA 0.1
#define CCG_RHO   0.0001

#define SIGN(a, b) (((b) >= (0)) ? (fabs(a)) : (-fabs(a)))
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

